<template>
	<view class="ikz-school">
		<ikz-loading :css-data="loading_css"></ikz-loading>
		<!-- <ikz-topbg></ikz-topbg> -->
		<!-- type == 1-->
		<block v-if="form_data.type == 1">
			<view class="ikz-form">
				<view class="ikz-form-input-box">
					<!-- <image class="ikz-form-input-img" src="/static/campus/takeaddr.png"></image> -->
					<view class="qubox">
						取
					</view>
					<view class="quaddressbox">
						<view class="quaddress">
							取货地点
						</view>
						<input v-model="form_data.start" class="ikz-form-input" placeholder="请输入取货地点" />
					</view>
				</view>
				<view class="ikz-form-input-box ikz-afters" @click="goaddress">
					<!-- <image class="ikz-form-input-img" src="/static/campus/giveaddr.png"></image> -->
					<view class="shoubox">
						收
					</view>
					<view class="quaddressbox">
						<view class="quaddress">
							收货地点
						</view>
						<!-- <input v-model="form_data.start" class="ikz-form-input" placeholder="请输入收货地点" /> -->
						<view v-if="!address_default">请选择收货地点</view>
						<view class="ikz-form-address" v-else>
							{{address_default.name}}-{{address_default.mobile}}
							<view class="ikz-form-address-detail">
								{{address_default.group_name}}-{{address_default.detail}}
							</view>
						</view>
					</view>

				</view>
			</view>
			<view class="ikz-form-input-box ikz-afters">
				<view class="leftbox">
					<image class="ikz-form-input-img" src="/static/campus/qiw.png"></image>
					<view class="txts">
						期望送达
					</view>
				</view>
				<view style="width: 40%;">
					<ikz-datetime @returnTime="returnTime"></ikz-datetime>
				</view>
			</view>
			<!-- 其他信息 -->
			<view class="ikz-tips">
				<view class="ikz-tips-title">
					<image class="ikz-form-input-img" src="/static/campus/notes.png" mode=""></image>
					备注需求
				</view>
				<view class="ikz-tips-box">
					<textarea v-model="form_data.remarks" class="ikz-tips-text" placeholder="请输入物品信息、配送要求等。"></textarea>
				</view>
			</view>
			<!-- <view class="ikz-take">
       <ikz-updata></ikz-updata>
      </view> -->
			<view class="ikz-form-price-box">
				<view class="ikz-form-price-title">
					<image class="ikz-form-input-img" src="/static/campus/money.png" mode=""></image>
					跑腿费
				</view>
				<input @input="check" @blur="checkPrice" v-model="form_data.price" type="digit"
					class="ikz-form-price-input" style="width: 75%;text-align: right;" placeholder="请输入跑腿费" />
			</view>
		</block>

		<!-- type == 2 -->
		<block v-if="form_data.type == 2">
			<view class="ikz-form">
				<view class="ikz-form-input-box">
					<view class="qubox">
						取
					</view>
					<view class="quaddressbox" @click="toaddress">
						<view class="quaddress">
							快递站点
						</view>
						<view class="ikz-form-input">
							{{group_name?group_name:'请选择快递站点'}}
						</view>
					</view>
				</view>
				<view class="ikz-form-input-box ikz-afters" @click="goaddress">
					<view class="shoubox">
						收
					</view>
					<view class="quaddressbox">
						<view class="quaddress">
							收货地点
						</view>
						<view v-if="!address_default">请选择收货地点</view>
						<view class="ikz-form-address" v-else>
							{{address_default.name}}-{{address_default.mobile}}
							<view class="ikz-form-address-detail">
								{{address_default.group_name}}-{{address_default.detail}}
							</view>
						</view>
					</view>

				</view>
			</view>

			<view class="ikz-form-input-box ikz-afters">
				<view class="leftbox">
					<image class="ikz-form-input-img" src="/static/campus/qiw.png"></image>
					<view class="txts">
						期望送达
					</view>
				</view>
				<view style="width: 40%;">
					<ikz-datetime @returnTime="returnTime"></ikz-datetime>
				</view>
			</view>
			<!-- 其他信息 -->
			<view class="ikz-tips">
				<view class="ikz-tips-title">
					<image class="ikz-form-input-img" src="/static/campus/notes.png" mode=""></image>
					代买信息
				</view>
				<view class="ikz-tips-box">
					<textarea v-model="form_data.remarks" class="ikz-tips-text" placeholder="请输入物品信息、配送要求等。"></textarea>
				</view>
			</view>
			<view class="ikz-form-price-box">
				<view class="ikz-form-price-title">
					<image class="ikz-form-input-img" src="/static/campus/money.png" mode=""></image>
					跑腿费
				</view>
				<input @input="check" @blur="checkPrice" v-model="form_data.price" type="digit"
					class="ikz-form-price-input" style="width: 75%;text-align: right;" placeholder="请输入跑腿费" />
			</view>
		</block>

		<!-- type == 2 -->

		<!-- type == 3 -->
		<block v-if="form_data.type == 3">
			<view class="ikz-form">
				<view class="ikz-form-input-box">
					<view class="qubox">
						取
					</view>
					<!-- <view class="quaddressbox" @click="toaddress">	 -->
					<view class="quaddressbox">
						<view class="quaddress">
							学校食堂
						</view>
						<!-- <view class="ikz-form-input">
							{{group_name?group_name:'请选择学校食堂'}}
						</view> -->
						<input v-model="form_data.start" class="ikz-form-input" placeholder="请选择学校食堂" />
					</view>
				</view>
				<view class="ikz-form-input-box ikz-afters" @click="goaddress">
					<view class="shoubox">
						收
					</view>
					<view class="quaddressbox">
						<view class="quaddress">
							收货地点
						</view>
						<view v-if="!address_default">请选择收货地点</view>
						<view class="ikz-form-address" v-else>
							{{address_default.name}}-{{address_default.mobile}}
							<view class="ikz-form-address-detail">
								{{address_default.group_name}}-{{address_default.detail}}
							</view>
						</view>
					</view>

				</view>
			</view>

			<view class="ikz-form-input-box ikz-afters">
				<view class="leftbox">
					<image class="ikz-form-input-img" src="/static/campus/qiw.png"></image>
					<view class="txts">
						期望送达
					</view>
				</view>
				<view style="width: 40%;">
					<ikz-datetime @returnTime="returnTime"></ikz-datetime>
				</view>
			</view>
			<!-- 其他信息 -->
			<view class="ikz-tips">
				<view class="ikz-tips-title">
					<image class="ikz-form-input-img" src="/static/campus/notes.png" mode=""></image>
					代买信息
				</view>
				<view class="ikz-tips-box">
					<textarea v-model="form_data.remarks" class="ikz-tips-text" placeholder="请输入物品信息、配送要求等。"></textarea>
				</view>
			</view>
			<view class="ikz-form-price-box">
				<view class="ikz-form-price-title">
					<image class="ikz-form-input-img" src="/static/campus/money.png" mode=""></image>
					跑腿费
				</view>
				<input @input="check" @blur="checkPrice" v-model="form_data.price" type="digit"
					class="ikz-form-price-input" style="width: 75%;text-align: right;" placeholder="请输入跑腿费" />
			</view>
		</block>
		<!-- type == 3 -->
		<!-- type == 4-->
		<block v-if="form_data.type == 4">

			<view class="ikz-form">
				<view class="ikz-form-input-box">
					<view class="qubox">
						取
					</view>
					<view class="quaddressbox" @click="toaddress">
						<view class="quaddress">
							学校超市
						</view>
						<view class="ikz-form-input">
							{{group_name?group_name:'请选择学校超市'}}
						</view>
					</view>
				</view>
				<view class="ikz-form-input-box ikz-afters" @click="goaddress">
					<view class="shoubox">
						收
					</view>
					<view class="quaddressbox">
						<view class="quaddress">
							收货地点
						</view>
						<view v-if="!address_default">请选择收货地点</view>
						<view class="ikz-form-address" v-else>
							{{address_default.name}}-{{address_default.mobile}}
							<view class="ikz-form-address-detail">
								{{address_default.group_name}}-{{address_default.detail}}
							</view>
						</view>
					</view>

				</view>
			</view>

			<view class="ikz-form-input-box ikz-afters">
				<view class="leftbox">
					<image class="ikz-form-input-img" src="/static/campus/qiw.png"></image>
					<view class="txts">
						期望送达
					</view>
				</view>
				<view style="width: 40%;">
					<ikz-datetime @returnTime="returnTime"></ikz-datetime>
				</view>
			</view>
			<!-- 其他信息 -->
			<view class="ikz-tips">
				<view class="ikz-tips-title">
					<image class="ikz-form-input-img" src="/static/campus/notes.png" mode=""></image>
					代买信息
				</view>
				<view class="ikz-tips-box">
					<textarea v-model="form_data.remarks" class="ikz-tips-text" placeholder="请输入物品信息、配送要求等。"></textarea>
				</view>
			</view>
			<view class="ikz-form-price-box">
				<view class="ikz-form-price-title">
					<image class="ikz-form-input-img" src="/static/campus/money.png" mode=""></image>
					跑腿费
				</view>
				<input @input="check" @blur="checkPrice" v-model="form_data.price" type="digit"
					class="ikz-form-price-input" style="width: 75%;text-align: right;" placeholder="请输入跑腿费" />
			</view>
		</block>

		<!-- type == 5-->
		<block v-if="form_data.type == 5">
			<view class="ikz-form">
				<view class="ikz-form-input-box">
					<view class="qubox">
						取
					</view>
					<view class="quaddressbox" @click="toaddress">
						<view class="quaddress">
							学校超市
						</view>
						<view class="ikz-form-input">
							{{group_name?group_name:'请选择学校超市'}}
						</view>
					</view>
				</view>
				<view class="ikz-form-input-box ikz-afters" @click="goaddress">
					<view class="shoubox">
						收
					</view>
					<view class="quaddressbox">
						<view class="quaddress">
							收货地点
						</view>
						<view v-if="!address_default">请选择收货地点</view>
						<view class="ikz-form-address" v-else>
							{{address_default.name}}-{{address_default.mobile}}
							<view class="ikz-form-address-detail">
								{{address_default.group_name}}-{{address_default.detail}}
							</view>
						</view>
					</view>

				</view>
			</view>

			<view class="ikz-form-input-box ikz-afters">
				<view class="leftbox">
					<image class="ikz-form-input-img" src="/static/campus/qiw.png"></image>
					<view class="txts">
						期望送达
					</view>
				</view>
				<view style="width: 40%;">
					<ikz-datetime @returnTime="returnTime"></ikz-datetime>
				</view>
			</view>
			<!-- 其他信息 -->
			<view class="ikz-tips">
				<view class="ikz-tips-title">
					<image class="ikz-form-input-img" src="/static/campus/notes.png" mode=""></image>
					代买信息
				</view>
				<view class="ikz-tips-box">
					<textarea v-model="form_data.remarks" class="ikz-tips-text" placeholder="请输入物品信息、配送要求等。"></textarea>
				</view>
			</view>
			<view class="ikz-form-price-box">
				<view class="ikz-form-price-title">
					<image class="ikz-form-input-img" src="/static/campus/money.png" mode=""></image>
					跑腿费
				</view>
				<input @input="check" @blur="checkPrice" v-model="form_data.price" type="digit"
					class="ikz-form-price-input" style="width: 75%;text-align: right;" placeholder="请输入跑腿费" />
			</view>
		</block>
		<!-- type == 5-->

		<!-- type == 6-->
		<block v-if="form_data.type == 6">
			<view class="ikz-tips">
				<view class="ikz-tips-title">
					<image class="ikz-form-input-img" src="/static/campus/notes.png" mode=""></image>
					备注信息
				</view>
				<view class="ikz-tips-box">
					<textarea v-model="form_data.remarks" class="ikz-tips-text"
						placeholder="请输帮助需求，请根据实际需求填写帮助信息例:帮忙布置表白现场，道具已买，需要一个细心的女生协助 如需女同学接单请备注~"></textarea>
				</view>
			</view>
			<view class="ikz-form-input-box ikz-afters" @click="goaddress">
				<image src="/static/index/index_wn.png" style="width: 68rpx;height: 68rpx;" mode=""></image>
				<view class="quaddressbox">
					<view class="quaddress">
						帮帮地址
					</view>
					<view v-if="!address_default">请选择收货地点</view>
					<view class="ikz-form-address" v-else>
						{{address_default.name}}-{{address_default.mobile}}
						<view class="ikz-form-address-detail">
							{{address_default.group_name}}-{{address_default.detail}}
						</view>
					</view>
				</view>

			</view>
			<view class="ikz-form-input-box ikz-afters">
				<view class="leftbox">
					<image class="ikz-form-input-img" src="/static/campus/qiw.png"></image>
					<view class="txts">
						开始时间
					</view>
				</view>
				<view style="width: 40%;">
					<ikz-datetime @returnTime="returnTime"></ikz-datetime>
				</view>
			</view>
			<!-- 其他信息 -->

			<view class="ikz-form-price-box">
				<view class="ikz-form-price-title">
					<image class="ikz-form-input-img" src="/static/campus/money.png" mode=""></image>
					金额
				</view>
				<input @input="check" @blur="checkPrice" v-model="form_data.price" type="digit"
					class="ikz-form-price-input" style="width: 75%;text-align: right;" placeholder="请输入跑腿费" />
			</view>
		</block>
		<!-- type == 6-->

		<view class="ikz-tips">
			<view class="ikz-tips-title">
				<image class="ikz-form-input-img" src="/static/campus/tips.png" mode=""></image>
				提示说明
			</view>
			<view class="ikz-tips-box">
				<!-- <textarea v-model="form_data.remarks" class="ikz-tips-text" placeholder="请输入备注信息"></textarea>	 -->
				{{tips}}
			</view>
		</view>
		<!-- <view class="ikz-take">
			<ikz-updata @returnFiles="returnFiles"></ikz-updata>
		</view> -->

		<view class="xieyibox">

			<image style="width: 28rpx;height: 28rpx;" v-if="isShow" @click="isShow = !isShow"
				src="/static/index/yes.png" mode=""></image>
			<image style="width: 28rpx;height: 28rpx;" v-else @click="isShow = !isShow" src="/static/index/no.png"
				mode="">
			</image>
			已阅读并同意<text style="color: #000;" @click="navto1">《用户协议》</text>和<text style="color: #000;"
				@click="toyins">《隐私政策》</text>
		</view>
		<view style="height:230rpx">

		</view>
		<view class="ikz-bottom">
			<view class="topyouhui">
				<view class="leftbox">
					<view class="youhui">
						暂无优惠券可用
					</view>
				</view>
				<view class="rightbox">
					<text style="color: #AFAFAF;">支付方式：</text>微信支付
				</view>
			</view>
			<view class="ikz-bottom-box">
				<view class="price-left">
					<view class="ikz-bottom-price">￥{{form_data.total_fee||0}}</view>
					<view class="zuidi">
						最低20元
					</view>
				</view>
				<view class="ikz-bottom-btn" @click="setUp">
					立即发布
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	import ikzLoading from '@/pages/Component/Public/Loading/loading.vue';
	import ikzTopbg from '@/pages/Component/Public/Topbg/public/topbg/topbg.vue';
	import ikzUpdata from '@/pages/Component/Public/Updata/public/updata/updata.vue';
	import ikzDatetime from '@/pages/Component/Public/Pickertime/public/datetime/index.vue';
	var app = getApp( );
	import ikz from '@/pages/Common/tools.js';
	export default {
		components: {
			ikzLoading,
			ikzTopbg,
			ikzUpdata,
			ikzDatetime
		},
		data( ) {
			return {
				isShow: false,
				address_default: '',
				loading_css: {
					display: 'flex',
				},
				form_data: {
					type: 1,
					game_platform_name: '', //平台名称
					game_platform: '', //游戏平台
					game_time: '1小时', //游戏时间
					receive_limit: '不限性别', //游戏接单限制
					lease_duration: '1小时归还', //租借时长
					down_url: '', //下载链接
					receive_email: '', //收件邮箱
					start: '',
					destination: '',
					hope_arrive: '',
					information: '',
					price: '',
					remarks: '',
					reward: '',
					total_fee: 0,
					annex_information_images: [ ],
					express_temp: [ ]
				},
				point_info: '',
				express_box: [ ],
				files: [ ],
				game_name_data: [ ], //游戏陪玩 
				game_name_index: 0,
				game_time_data: [ {
						id: 1,
						name: '1小时'
					},
					{
						id: 2,
						name: '2小时'
					},
					{
						id: 3,
						name: '3小时'
					},
					{
						id: 4,
						name: '4小时'
					},
				], //陪玩时间
				game_time_index: 0,
				game_gender: [ '不限性别', '仅限男生', '仅限女生' ],
				game_gender_index: 0,
				lease_time: [ '1小时归还', '2小时归还', '3小时归还', '4小时归还' ], //租借时长
				lease_index: 0,
				lease_return_time: '09:00', //租借时长
				up_status: 2,
				file_info: '',
				min_price: app.globalData.min_price,
				tips: '东西多、重、楼栋高、路程远建议加价',
				group_name: ''
			}
		},
		onLoad( options ) {
			if ( !options ) {
				return
			}
			this.form_data.type = options.type;
			if ( this.form_data.type == 1 ) {
				this.loading_css.display = 'none';
				uni.setNavigationBarTitle( {
					title: '校园跑腿'
				} );
			} else if ( this.form_data.type == 2 ) {
				this.expressBox( ( res ) => {
					this.loading_css.display = 'none';
				} );
				uni.setNavigationBarTitle( {
					title: '快递代取'
				} );
			} else if ( this.form_data.type == 3 ) {
				this.ganmeList( ( res ) => {
					this.loading_css.display = 'none';
				} );
				uni.setNavigationBarTitle( {
					title: '食堂代买'
				} );
			} else if ( this.form_data.type == 4 ) {
				this.form_data.hope_arrive = '09:00';
				this.loading_css.display = 'none';
				uni.setNavigationBarTitle( {
					title: '超市代买'
				} );
			} else if ( this.form_data.type == 5 ) {
				this.loading_css.display = 'none';
				uni.setNavigationBarTitle( {
					title: '快递代寄'
				} );
				this.fileInfo( );
			} else if ( this.form_data.type == 6 ) {
				this.loading_css.display = 'none';
				uni.setNavigationBarTitle( {
					title: '万能帮'
				} );
			}
		},
		onShow( ) {
			this.address_default = app.globalData.user_address.address_default;
			this.form_data.destination = this.address_default.id;
			if ( this.form_data.type == 2 ) {
				this.point_info = app.globalData.point_info || '';
				this.form_data.start = app.globalData.point_info.id || '';
			}
			var group_name = app.globalData.campus_data;
			if ( group_name ) {
				this.group_name = group_name;
			} else {
				this.group_name = '请选择地址/楼栋';
			}
			this.$forceUpdate( );
		},
		methods: {
			navto1( type, title ) {
				uni.navigateTo( {
					url: '/pages/Component/Module/Other/Program/agreement/index'
				} )
			},
			toyins( ) {
				uni.navigateTo( {
					url: '/pages/Component/Module/Other/Program/insiinfo/insiinfo'
				} )
			},
			fileInfo( ) {
				var path = '/xyb/same/document_download_instructions';
				var data = {}
				ikz.post( path, data, ( res ) => {
					if ( res.data.code ) {
						this.file_info = res.data.data.value;
					} else {
						uni.showModal( {
							title: '提示',
							content: res.data.msg,
							showCancel: false,
							success: function( res ) {}
						} );
					}
				} );
			},
			setUsp( ) {

			},
			/* type == 4*/
			leasePickerChange( e ) {
				this.lease_index = e.detail.value;
				this.form_data.lease_duration = this.lease_time[ this.lease_index ];
			},
			hopeArrivePickerChange( e ) {
				this.form_data.hope_arrive = e.detail.value;
			},
			/* type == 4*/
			/* type == 3*/
			gameGenderPickerChange( e ) {
				this.game_gender_index = e.detail.value;
				this.receive_limit = this.game_gender[ this.game_gender_index ];
			},
			// gamePickerChange( e ) {
			// 	this.game_name_index = e.detail.value;
			// 	this.form_data.game_platform = this.game_name_data[ this.game_name_index ].id;
			// 	this.form_data.game_platform_name = this.game_name_data[ this.game_name_index ].name;
			// },
			// gameTimePickerChange( e ) {
			// 	this.game_time_index = e.detail.value;
			// 	this.form_data.game_time = this.game_time_data[ this.game_time_index ].name;
			// },
			ganmeList( fn ) {
				var path = '/xyb/agent_games/index';
				var data = {}
				ikz.post( path, data, ( res ) => {
					if ( res.data.code ) {
						this.game_name_data = res.data.data;
						this.form_data.game_platform = this.game_name_data[ 0 ].id;
						this.form_data.game_platform_name = this.game_name_data[ 0 ].name;
					} else {
						uni.showModal( {
							title: '提示',
							content: res.data.msg,
							showCancel: false,
							success: function( res ) {}
						} );
					}
					fn( );
				} );
			},
			/* type==2*/
			//快递点地址
			getExpress( ) {
				uni.navigateTo( {
					url: '/pages/Component/Module/Campus/Program/Express/point/index'
				} )
			},
			//增加包裹
			addExpress( index ) {
				this.express_box[ index ].number++;
				this.form_data.total_fee = ( parseFloat( this.express_box[ index ].price ) + parseFloat( this.form_data
					.total_fee ) ).toFixed( 2 );
			},
			//减少包裹
			reduceExpress( index ) {
				this.express_box[ index ].number--;
				this.form_data.total_fee = ( parseFloat( this.form_data.total_fee ) - parseFloat( this.express_box[ index ]
					.price ) ).toFixed( 2 )
			},
			//请求包裹数据 
			expressBox( fn ) {
				var path = '/xyb/same/express_config';
				var data = {}
				ikz.post( path, data, ( res ) => {
					if ( res.data.code ) {
						this.express_box = res.data.data.express_config;
						for ( var i = 0; i < this.express_box.length; i++ ) {
							this.express_box[ i ].number = 0;
						}
					} else {
						uni.showModal( {
							title: '提示',
							content: res.data.msg,
							showCancel: false,
							success: function( res ) {}
						} );
					}
					fn( );
				} );
			},
			/* type == 2*/
			//返回图片数据 
			returnFiles( e ) {
				this.files = e;
				console.log( e );
			},
			//提交数据
			setUp( ) {
				if ( !uni.getStorageSync( 'local_user_session' ) ) {
					uni.navigateTo( {
						url: "/pages/login/index"
					} )
					return
				}
				this.up_status = 3;
				if ( this.form_data.type == 1 ) {
					if ( !this.address_default ) {
						wx.showToast( {
							title: '请填选择收货地址',
							icon: 'none',
							duration: 2000
						} )
						return
					}
					this.runerrandsUp( );
				} else if ( this.form_data.type == 2 ) {
					if ( !this.address_default ) {
						wx.showToast( {
							title: '请填选择收货地址',
							icon: 'none',
							duration: 2000
						} )
						return
					}
					this.expressUp( );
				} else if ( this.form_data.type == 3 ) {
					this.gameUp( );
				} else if ( this.form_data.type == 4 ) {
					if ( !this.address_default ) {
						wx.showToast( {
							title: '请填选择收货地址',
							icon: 'none',
							duration: 2000
						} )
						return
					}
					this.leaseUp( );
				} else if ( this.form_data.type == 5 ) {
					this.fileUp( );
				} else if ( this.form_data.type == 6 ) {
					if ( !this.address_default ) {
						wx.showToast( {
							title: '请填选择收货地址',
							icon: 'none',
							duration: 2000
						} )
						return
					}
					this.otherUp( );
				}

			},
			otherUp( ) {
				uni.showLoading( {
					title: '加载中'
				} )
				if ( this.form_data.price == '' ) {
					wx.showToast( {
						title: '请填写帮助费',
						icon: 'none',
						duration: 2000
					} )
					return
				}
				if ( parseFloat( this.form_data.price ) < parseFloat( app.globalData.min_price ) ) {
					wx.showToast( {
						title: '帮助费最低为' + app.globalData.min_price + '元',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				if ( this.form_data.price >= 10000 ) {
					wx.showToast( {
						title: '帮助费小于1万元',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				if ( this.form_data.destination == '' ) {
					wx.showToast( {
						title: '请选择收货地点',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				if ( this.form_data.remarks == '' ) {
					wx.showToast( {
						title: '请输入帮助内容',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				this.goOrderIndex( );
			},
			fileUp( ) {
				uni.showLoading( {
					title: '加载中'
				} )
				if ( this.form_data.price == '' ) {
					wx.showToast( {
						title: '请填写下载费',
						icon: 'none',
						duration: 2000
					} )
					return
				}
				if ( parseFloat( this.form_data.price ) < parseFloat( app.globalData.min_price ) ) {
					wx.showToast( {
						title: '下载费最低为' + app.globalData.min_price + '元',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				if ( this.form_data.down_url == '' ) {
					wx.showToast( {
						title: '请输入下载链接',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				if ( this.form_data.receive_email == '' ) {
					wx.showToast( {
						title: '请输入收件邮箱',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				this.goOrderIndex( );
			},
			leaseUp( ) {
				uni.showLoading( {
					title: '加载中'
				} )
				if ( this.form_data.price == '' ) {
					wx.showToast( {
						title: '请填写租借费',
						icon: 'none',
						duration: 2000
					} )
					return
				}
				if ( parseFloat( this.form_data.price ) < parseFloat( app.globalData.min_price ) ) {
					wx.showToast( {
						title: '租借费最低为' + app.globalData.min_price + '元',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				if ( this.form_data.price >= 10000 ) {
					wx.showToast( {
						title: '租借费小于1万元',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				if ( this.form_data.destination == '' ) {
					wx.showToast( {
						title: '请选择收货地点',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				if ( this.form_data.remarks == '' ) {
					wx.showToast( {
						title: '请输入租借物品需求',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				this.goOrderIndex( );
			},
			//游戏陪玩
			gameUp( ) {
				uni.showLoading( {
					title: '加载中'
				} )
				if ( this.form_data.price == '' ) {
					wx.showToast( {
						title: '请填写跑腿费',
						icon: 'none',
						duration: 2000
					} )
					return
				}
				if ( parseFloat( this.form_data.price ) < parseFloat( app.globalData.min_price ) ) {
					wx.showToast( {
						title: '跑腿费最低为' + app.globalData.min_price + '元',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				if ( this.form_data.price >= 10000 ) {
					wx.showToast( {
						title: '跑腿费小于1万元',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				if ( this.form_data.remarks == '' ) {
					wx.showToast( {
						title: '请输入跑腿信息',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				this.goOrderIndex( );
			},
			//快递
			expressUp( ) {
				uni.showLoading( {
					title: '加载中'
				} )
				//判断填写数据是否正确
				if ( this.form_data.start == '' ) {
					wx.showToast( {
						title: '请输入取货地点',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				if ( this.form_data.destination == '' ) {
					wx.showToast( {
						title: '请选择收货地点',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				if ( this.form_data.hope_arrive == '' ) {
					wx.showToast( {
						title: '请选择送达时间',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				if ( this.form_data.remarks == '' ) {
					wx.showToast( {
						title: '请输入取件信息',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				this.form_data.express_temp = [ ];
				for ( var i = 0; i < this.express_box.length; i++ ) {
					if ( this.express_box[ i ].number ) {
						this.form_data.express_temp.push( this.express_box[ i ] );
					}
				}
				if ( this.form_data.express_temp.length == 0 ) {
					wx.showToast( {
						title: '请选择快递单件',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				this.form_data.express_temp = JSON.stringify( this.form_data.express_temp );
				console.log( this.form_data )
				this.goOrderIndex( );
			},
			runerrandsUp( ) {
				uni.showLoading( {
					title: '加载中'
				} )
				//判断填写数据是否正确
				if ( this.form_data.start == '' ) {
					wx.showToast( {
						title: '请输入取货地点',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				if ( this.form_data.destination == '' ) {
					wx.showToast( {
						title: '请选择收货地点',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				if ( this.form_data.hope_arrive == '' ) {
					wx.showToast( {
						title: '请选择送达时间',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				if ( this.form_data.remarks == '' ) {
					wx.showToast( {
						title: '请输入帮助信息',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				if ( this.form_data.price == '' ) {
					wx.showToast( {
						title: '请输入跑腿费',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				if ( parseFloat( this.form_data.price ) < parseFloat( app.globalData.min_price ) ) {
					wx.showToast( {
						title: '跑腿费最低为' + app.globalData.min_price + '元',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				if ( this.form_data.price >= 10000 ) {
					wx.showToast( {
						title: '跑腿费小于1万元',
						icon: 'error',
						duration: 2000
					} )
					return
				}
				this.goOrderIndex( );
			},
			goOrderIndex( ) {
				if ( this.files.length ) {
					//循环上传图片
					this.upImg( 0, ( res ) => {
						uni.hideLoading( );
						this.form_data.total_price = this.form_data.total_fee
						var path = '/pages/Component/Module/Campus/Program/Runerrands/detail/index'
						ikz.nav( path, 'ln', this.form_data );
					} );
				} else {
					uni.hideLoading( );
					this.form_data.total_price = this.form_data.total_fee
					var path = '/pages/Component/Module/Campus/Program/Runerrands/detail/index'
					ikz.nav( path, 'ln', this.form_data );
				}
			},
			//上传图片
			upImg( index, fn ) {
				uni.showLoading( {
					title: '加载中'
				} )
				var that = this;
				var path = "/common/upload";
				var data = {}
				ikz.up( path, data, 'file', this.files[ index ], ( res ) => {
					var temp_result_data = JSON.parse( res.data );
					if ( temp_result_data.code ) {
						uni.hideLoading( );
						that.form_data.annex_information_images.push( temp_result_data.data.url );
						if ( that.files.length == ( index + 1 ) ) {
							fn( );
						} else {
							index++
							that.upImg( index, fn )
						}
					} else {
						uni.showModal( {
							title: '提示',
							content: temp_result_data.msg,
							showCancel: false,
							success: function( res ) {}
						} );
						uni.hideLoading( );
					}
				} )
			},
			//返回时间
			returnTime( e ) {
				console.log( "父页面接收的时间", e );
				this.form_data.hope_arrive = e
				console.log( "父页面hope_arrive", this.form_data.hope_arrive );
			},
			check: function( e ) {
				//正则表达试
				e.target.value = ( e.target.value.match( /^\d*(\.?\d{0,2})/g )[ 0 ] ) || ''
				//重新赋值给input
				this.$nextTick( ( ) => {
					this.form_data.price = e.target.value
				} )
			},
			checkPrice( ) {
				if ( this.form_data.price ) {
					this.form_data.price = parseFloat( this.form_data.price ).toFixed( 2 );
				}
				this.form_data.total_fee = this.form_data.price;
			},
			//我的地址
			goaddress( ) {
				uni.navigateTo( {
					url: '/pages/Component/Module/Address/Program/myAddress/index'
				} )
			},
			toaddress( ) {
				app.globalData.campus_data = '';
				uni.navigateTo( {
					url: '/pages/Component/Module/Address/Program/selectAddress/index'
				} )
			}
		}
	};
</script>

<style>
	page {
		width: 100%;
		height: 100%;
		background: #F3F3F3;
	}

	.ikz-top-bg {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		z-index: -1;
	}

	.ikz-school {
		width: 100%;
		height: 100%;
	}

	.ikz-form {
		width: 100%;
		height: 350rpx;
		background-color: #fff;
	}

	.qubox {
		width: 64rpx;
		height: 64rpx;
		background: #F5F5F5;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		font-weight: 500;
		font-size: 30rpx;
		color: #000000;
		text-align: center;
		line-height: 64rpx;
	}

	.quaddressbox {
		width: 598rpx;
		/* height: 2rpx; */
		margin-left: 10rpx;
	}

	.quaddress {
		width: 100%;
		height: 44rpx;
		font-weight: 500;
		font-size: 30rpx;
		color: #000000;
		text-align: left;
	}

	.shoubox {
		width: 64rpx;
		height: 64rpx;
		background: #247EFF;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		font-weight: 500;
		font-size: 30rpx;
		color: #FFFFFF;
		text-align: center;
		line-height: 64rpx;
	}

	.leftbox {
		width: 50%;
		/* height: 64rpx; */
		display: flex;
	}

	.txts {
		width: 104rpx;
		height: 38rpx;
		font-weight: 400;
		font-size: 26rpx;
		color: #000000;
		text-align: left;
		line-height: 38rpx;
	}

	.ikz-form-input-address {
		width: 750rpx;
		height: 150rpx;
		background: #FFFFFF;
		margin: 30rpx auto 0;
		box-sizing: border-box;
		padding: 30rpx;
	}

	/* 输入 */
	.ikz-form-input-box {
		box-sizing: border-box;
		padding: 30rpx;
		width: 100%;
		margin: 30rpx auto 0;
		display: flex;
		align-items: center;
		background-color: #fff;
		justify-content: space-between;
	}

	.ikz-form-input {
		width: 85%;
		color: #AFAFAF;
		font-size: 26rpx;
	}

	.ikz-form-input-img {
		width: 50rpx;
		height: 50rpx;
		margin-right: 10rpx;
	}

	.ikz-form-address {
		font-size: 28rpx;
	}

	.ikz-form-address-detail {
		color: #828282;
	}

	/* 输入 */

	/* 其他 */
	.ikz-tips {
		box-sizing: border-box;
		padding: 30rpx;
		width: 100%;
		margin: 30rpx auto 0;
		background: #fff;
	}

	.ikz-tips-title {
		display: flex;
		align-items: center;
		font-weight: 400;
		font-size: 26rpx;
		color: #000000;
		text-align: left;
	}

	.ikz-tips-box {
		margin-top: 20rpx;
		width: 100%;
		min-height: 100rpx;
		font-weight: 400;
		font-size: 22rpx;
		color: #FF4F21;
		text-align: left;
	}

	.ikz-tips-text {
		box-sizing: border-box;
		padding: 10rpx;
		width: 100%;
		height: 200rpx;
		border-radius: 15rpx;
		font-size: 28rpx;
		background-color: #F5F5F5;
	}

	/* 其他 */
	/* 底部 */
	.ikz-bottom {
		position: fixed;
		bottom: 0px;
		left: 0px;
		display: flex;
		align-items: center;
		width: 100%;
		height: 234rpx;
		background: #FFFFFF;
		border-radius: 24rpx 24rpx 0rpx 0rpx;
		z-index: 99;
		display: flex;
		align-items: center;
		flex-direction: column;
	}

	.rightbox {
		font-weight: 400;
		font-size: 24rpx;
		color: #247EFF;
		text-align: left;
	}

	.leftbox {
		font-weight: 400;
		font-size: 24rpx;
		color: #AFAFAF;
		text-align: left;
	}

	.topyouhui {
		width: 100%;
		height: 36rpx;
		display: flex;
		align-items: center;
		padding: 0 90rpx;
		box-sizing: border-box;
		margin-bottom: 20rpx;
	}

	.price-left {
		display: flex;
	}


	.ikz-bottom-box {
		width: 690rpx;
		height: 88rpx;
		margin: 0 auto;
		display: flex;
		align-items: center;
		justify-content: space-between;
		background: #F5F5F5;
		border-bottom-left-radius: 60rpx;
		border-bottom-right-radius: 60rpx;
		border-top-right-radius: 60rpx;
		border-top-left-radius: 60rpx;
	}

	.ikz-bottom-price {
		margin-left: 50rpx;
		color: #247EFF;
		font-weight: 800;
		border-right: 1rpx solid #AFAFAF;
	}

	.zuidi {
		width: 116rpx;
		height: 38rpx;
		background: #FFE8E2;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		font-weight: 400;
		font-size: 22rpx;
		color: #FF4F21;
		text-align: center;
		line-height: 38rpx;
		margin-left: 8rpx;
	}

	.ikz-form-price-title {
		width: 100%;
		height: 38rpx;
		font-weight: 400;
		font-size: 26rpx;
		color: #000000;
		text-align: left;
		display: flex;
		align-items: center;
	}

	.ikz-bottom-btn {
		box-sizing: border-box;
		padding: 0px 40rpx;
		height: 88rpx;
		line-height: 88rpx;
		color: #fff;
		/* border-bottom-left-radius: 60rpx; */
		border-bottom-right-radius: 60rpx;
		border-top-right-radius: 60rpx;
		/* border-top-left-radius: 60rpx; */
		background: #247EFF;
	}

	/* 底部 */
	.ikz-take {
		box-sizing: border-box;
		padding: 30rpx;
		width: 95%;
		margin: 30rpx auto 0;
		display: flex;
		align-items: center;
		justify-content: space-between;
		background: #fff;
		border-radius: 15rpx;
	}

	.ikz-form-price-box {
		box-sizing: border-box;
		padding: 30rpx;
		width: 100%;
		margin: 30rpx auto 0;
		background: #fff;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.ikz-afters {
		position: relative;
	}

	.ikz-afters:after {
		content: " ";
		display: inline-block;
		height: 6px;
		width: 6px;
		border-width: 2px 2px 0 0;
		border-color: #888;
		border-style: solid;
		-webkit-transform: matrix(0.71, 0.71, -.71, 0.71, 0, 0);
		transform: matrix(0.71, 0.71, -.71, 0.71, 0, 0);
		top: -2px;
		position: absolute;
		top: 50%;
		margin-top: -4px;
		right: 20px;
	}

	/* 快递 */
	.ikz-take {
		box-sizing: border-box;
		padding: 30rpx;
		width: 95%;
		margin: 30rpx auto 0;
		display: flex;
		align-items: center;
		justify-content: space-between;
		background: #fff;
		border-radius: 15rpx;
	}

	.xieyibox {
		box-sizing: border-box;
		padding: 30rpx;
		width: 100%;
		margin: 30rpx auto 0;
		display: flex;
		align-items: center;
		background: #fff;
		color: #AFAFAF;
		font-size: 22rpx;
	}

	.ikz-take-img {
		width: 80rpx;
		height: 80rpx;
	}

	.ikz-take-title {
		font-size: 30rpx;
	}

	.ikz-take-center {
		width: 50%;
		line-height: 50rpx;
	}

	.ikz-take-tips {
		color: #888888;
		font-size: 28rpx;
	}

	.ikz-take-option {
		width: 50rpx;
		height: 50rpx;
	}

	.ikz-take-right {
		width: 25%;
		display: flex;
		align-items: center;
	}

	.ikz-take-num {
		width: 40%;
		text-align: center;
	}

	/* 快递 */
</style>